<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>检查密码和确认密码是否相同</title>
		<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js"></script>
		<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css" />
		<link rel="stylesheet" href="../js/easyui/themes/icon.css" />
		<script type="text/javascript">
			$(function() {
				$.extend($.fn.validatebox.defaults.rules, {    
				    equals: {    
				        validator: function(value,param){    
				            return value == $(param[0]).val();    
				        },    
				        message: '密码不一致'   
				    }    
				});  
			})
		</script>
	</head>

	<body >
		password：<input id="pwd" name="pwd" type="password" class="easyui-validatebox" 				data-options="required:true" /><br />
		rpassword：<input id="rpwd" name="rpwd" type="password" class="easyui-validatebox"     
		    	required="required" validType="equals['#pwd']" />  
		
	</body>

</html>